import Taro from "@tarojs/taro";

// type cacheKey = "";
// type cacheKey = "userInfo" | "token";

export function setStore(key, value) {
  try {
    Taro.setStorageSync(key, value);
  } catch (e) {
    Taro.showToast({
      title: "本地存储失败!",
      icon: "error",
    });
  }
}

export function getStore(key) {
  try {
    return Taro.getStorageSync(key);
  } catch (e) {
    Taro.showToast({
      title: "本地数据获取失败!",
      icon: "error",
    });
  }
}
